package com.txd.mofa.adapter;


import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.txd.mofa.R;
import com.txd.mofa.bean.ShaixuanBean;

import java.util.Map;

public class ShaixuanAdapter extends BaseQuickAdapter<Map<String, String>, BaseViewHolder> {

    public ShaixuanAdapter(int layoutResId) {
        super(layoutResId);
    }


    @Override
    protected void convert(BaseViewHolder helper, Map<String, String> item) {



        ImageView iv = helper.getView(R.id.iv);
        TextView textView = helper.getView(R.id.tv);

        if (item.get("flag").equals("1")){
            Glide.with(mContext).load(item.get("img_shallow")).into(iv);
            textView.setTextColor(mContext.getResources().getColor(R.color.hui));
        }else {
            Glide.with(mContext).load(item.get("img_light")).into(iv);
            textView.setTextColor(mContext.getResources().getColor(R.color.huang));
        }


        helper.setText(R.id.tv,item.get("name"));


    }
}
